﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;

namespace l1cs.server.serverpackets
{
    public class S_Fishing : ServerBasePacket
    {
        private static Logger _log = Logger.getLogger( typeof( S_Fishing ).FullName );

        private byte[] _byte = null;

        public S_Fishing()
        {
            buildPacket();
        }

        public S_Fishing( int objectId, int motionNum, int x, int y )
        {
            buildPacket( objectId, motionNum, x, y );
        }

        private void buildPacket()
        {
            writeC( Opcodes.S_OPCODE_DOACTIONGFX );
            writeC( 0x37 ); // ?
            writeD( 0x76002822 ); // ?
            writeH( 0x8AC3 ); // ?
        }

        private void buildPacket( int objectId, int motionNum, int x, int y )
        {
            writeC( Opcodes.S_OPCODE_DOACTIONGFX );
            writeD( objectId );
            writeC( motionNum );
            writeH( x );
            writeH( y );
            writeD( 0 );
            writeH( 0 );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }
            return _byte;
        }

        override
        public String getType()
        {
            return "[S] S_Fishing";
        }
    }
}